package questionary;
/**
 * 
 * Clase que contiene la respusta de las preguntas de tipo 1, hereda los metodos 
 * y la informacion de la clase Question
 * @see Questionary
 */
public class SimpleQ extends Question {
	private String answer;
	
	/**
	 * Construye una pregunta de tipo 1
	 * @param question La pregunta
	 * @param answer La respuesta
	 * @param diffic La dificultad
	 * @param score El puntaje
	 */
	public SimpleQ (String question, String answer, int diffic, int score) {
		super(1, diffic, score, question);
		this.setAnswer(answer);
	}
	
	/**
	 * Setea la respuesta de la pregunta
	 * @param answer
	 */
	public void setAnswer(String answer) {
		this.answer = answer;
	}
	
	/**
	 * 
	 * @return La respuesta de la pregunta
	 */
	public String getAnswer() {
		return answer;
	}

	@Override
	public int getOptionsCount() {
		return 1;
	}

	@Override
	public String[] getOptions() {
		String [] ret = new String [1];
		ret[0] = answer;
		return ret;
	}

	@Override
	public boolean isCorrect(String [] s) {
		return answer.equals(s[0]);
	}
	
	@Override
	public boolean isCorrect(String s) {
		return answer.equals(s);
	}
	

	@Override
	public boolean isCorrect(Number n) {
		return false;
	}

	@Override
	public String[] getAnswers() {
		String [] ret = new String [1];
		ret[0] = answer;
		return ret;
	}

	@Override
	public int getCorrectOptionsCount() {
		return 1;
	}

	@Override
	public void setOptions(String[] array) {
		return;		
	}

	@Override
	public void setAnswers(String[] array) {
		this.answer = array[0];		
	}

	@Override
	public boolean isCorrect(String[] s, int answsize) {
		return false;
	}
}
